<template>
  <!-- #ifdef MP-WEIXIN -->
  <page-container :show="show" :z-index="-1" :overlay="false"
                  @beforeleave="onXBackPress"></page-container>
  <!-- #endif -->
  <!-- #ifndef MP -->
  <view></view>
  <!-- #endif -->
</template>

<script>
export default {
  name: 'WXPageBackIntercept',
  data() {
    return {
      show: true
    }
  },
  methods: {
    onXBackPress(e) {
      console.log('onMpBackPress', e)
      this.show = false
      this.$nextTick(() => {
        this.$emit('back', {from: 'mp', platform: 'weixin'})
      })
    },
    setData(show) {
      console.log('setData', show)
      this.show = show
    }
  }
}
</script>

<style scoped lang='scss'>
.WXPageBackIntercept-container {
}
</style>
